<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Repository\Product\GoodsRepository;
use App\Repository\UpThree\ThreeOrderRepository;
use App\Repository\UpThree\MainOrderRepostition;
use Illuminate\Support\Facades\DB;
use App\Repository\Product\SetAddressRepository;
use App\Repository\Product\ProductRepository;
use App\Repository\Api\GoodsRepository as apiGoods;
use App\Repository\Information\InformationRepository;
/**
 * @OA\Tag(
 *     name="后台菜单模块",
 *     description="菜单模块",
 * )
 */
class InformationController extends BaseController
{
  protected $InformationRepository;
  public function __construct()
  {
    $this->InformationRepository = new InformationRepository();
  }
  public function index(Request $request)
  {
    $where = [];
    if (!empty($request->get('phone'))) {
      $where['like']['phone'] = $request->get('phone');
    }

    if ($request->user->role_id != 1) {
      $where['where']['shop_id'] = $request->user->shop_id;
    }
    //时间验证 
    // var_dump($where);
    $data =  $this->InformationRepository->index($where);
    return $data;
    $datas = [];
    if (!empty($data['data'])) {
      foreach ($data['data'] as $key => $v) {
        // $datas[$v['name']] = $v['value'];
      }
    }
    return $this->returnMsg(200, '查询成功', $datas, 2);
  }

}
